<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>新增</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form" id="dynamicFieldForm"></div>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/js/auth/index.js" charset="utf-8"></script>
<script src="/js/form/form-build.js" charset="utf-8"></script>
<script>
    // 父级页面传递过来的数据
    var parentData = {}
    var $          = layui.jquery;
    function setData(loginInfo, url, detail, fields) {
        layui.use(['form'], function () {
            let form = layui.form;
            // 渲染表单
            DynamicForm.render("dynamicFieldForm", fields);
            // 监控提交
            form.on('submit(saveBtn)', function (data) {
                var req = data.field;
                req.status = FormatInt(req.status);
                Post(loginInfo ,url, req)
                return false;
            });
        });
    }
</script>
</body>
</html>